﻿#include"string.h"
int main()
{
	//char* str = new char[10] {"asdfghjkl"};
	//cout << strlen(str);

	my::string s1("abcdef");
	my::string s2(s1);
	my::string s3;
	
	s3 = s1;
	//cout << s1.c_str() << endl;
	//cout << s2.c_str() << endl;
	//cout << s3.c_str() << endl;
	//for (size_t i = 0; i < s1.size(); i++)
	//{
	//	s1[i]++;
	//	cout << s1[i] << endl;
	//}

	///*s1.resize(2);
	//cout << s1.c_str() << endl;

	//std::string s4("abcdef");
	//s4.resize(2);
	//cout << s4 << endl;

	//s2.push_back('a');
	//cout << s2.empty() << endl;*/

	//s1.append("ad");
	//cout << s1.c_str();

	my::string s5 = s1.substr(2, 2);
	cout << s5.c_str() << endl;

	s5.insert(0, 'a');
	cout << s5.c_str() << endl;

	s5.insert(0, "llll");
	cout << s5.c_str() << endl;

	s5.erase(0, 4);
	cout << s5.c_str() << endl;

	cout << s5.find('a') << endl;
	cout << s5.find("cd") << endl;

	cin >> s5;
	cout << s5 << endl;

	swap(s1, s5);
	cout << s1 << endl;
	cout << s5 << endl;
	return 0;
}